package cn.wolfcode.trip.base.domain;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.Date;

/**
 * 点赞类
 *
 * @author striveC
 */
@Getter
@Setter
@ToString
public class Love extends BaseDomain{
    public static final int TYPE_TRAVEL = 0;            //游记
    public static final int TYPE_STRATEGY = 1;          //攻略
    public static final int TYPE_STRATEGY_COMMENT = 2;  //点评
    public static final int TYPE_FRIENDCIRCLE = 3;      //动态

    public static final Boolean STATE_TRUE = true;      //有效
    public static final Boolean STATE_FALSE = false;    //无效

    public static final Boolean isread_true = true;     //已读
    public static final Boolean ISREAD_FALSE = false;   //未读

    /**
     * 用户id
     */
    private User user;
    /**
     * 作者id
     */
    private User author = new User();
    /**
     * 点赞内容的id
     */
    private Long typeId;
    /**
     * 点赞的类型
     */
    private Integer type;
    /**
     * 点赞是否有效(默认有效)
     */
    private Boolean state = STATE_TRUE;
    /**
     * 该赞的信息是否已读(默认未读)
     */
    private Boolean isRead = ISREAD_FALSE;
    /**
     * 绑定对应点赞内容标题
     */
    private String title;
    /**
     * 点赞时间
     */
    private Date creatTime;

    /**
     * 得到类型字符串
     */
    public String getTypeName(){
        String temp="";
        if(type == TYPE_TRAVEL){
            temp = "游记";
        }else if(type == TYPE_STRATEGY_COMMENT){
            temp = "点评";
        }else if(type == TYPE_FRIENDCIRCLE){
            temp = "动态";
        }
        return temp;
    }
}